package store

import (
	"yuanchang/spider/http"
	"yuanchang/spider/util/store/support"
)

type Store interface {
	Push(r *http.Request)
	Pop() *http.Request
}

func MakeStore(name string) Store {
	switch name {
	case "redis":
		return NewRedisStore()
	default:
		return nil
	}
}

func NewRedisStore() Store {
	storage := &support.RedisStore{}
	storage.Pool = support.NewRedisConnPool()
	return storage
}
